package com.isorf.test;



public class Dog {
    //属性
    private String name;
    private int age;
    private String sex;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    //无参的构造方法
    public Dog(){

    }

    public Dog(String name, int age, String sex) {
        this.name = name;
        this.age = age;
        this.sex = sex;
    }

    //方法   构造、静态 成员/实例方法
    //我会计算1+2+3.。。+100
    //静态方法
    public static int aaa() {
        int sum = 0;
        for (int i = 1; i <= 100; i++) {
            sum += i;
        }
        return sum;
    }

    //成员方法
    public String show() {
        return "我是小狗，我喜欢吃骨头,如果在没有肉的情况下";
    }
    //1 + 2 + ... +10
    public int sum10() {
        int sum = 0;
        for (int i = 1; i <= 10; i++) {
            sum += i;
        }
        return sum;
    }
    //正方形的面积
    public double square(double a) {
        return a * a;
    }

    //长方形的面积
    public double rectangle(double a, double b) {
        return a * b;
    }


    //三角形的周长
    public double triangle(double a, double b, double c) {
        return a + b + c;
    }


}
